<!DOCTYPE html>
<html dir="ltr" lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" type="image/png" sizes="16x16" th:href="@{/assets/images/favicon.png}">
    <title>修改方案·网络情报分析系统</title>

    <link th:href="@{/dist/css/style.min.css}" rel="stylesheet">
    <link th:href="@{/dist/css/custom.css}" rel="stylesheet">
    <link th:href="@{/assets/libs/sweetalert2/dist/sweetalert2.min.css}" rel="stylesheet">
    <link rel="stylesheet" type="text/css"
          th:href="@{/assets/libs/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css}">
    <link th:href="@{/assets/libs/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css}" rel="stylesheet"
          type="text/css">
    <script th:src="@{/common/analyze-cloud.js}"></script>
    <style>
        input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
            color: #b6b7b7 !important;
        }

        input:-moz-placeholder, textarea:-moz-placeholder {
            color: #b6b7b7 !important;
        }

        input::-moz-placeholder, textarea::-moz-placeholder {
            color: #b6b7b7 !important;
        }

        input:-ms-input-placeholder, textarea:-ms-input-placeholder {
            color: #b6b7b7 !important;
        }

        /*.switch{*/
        /*display:inline-block;*/
        /*}*/

        /*.bootstrap-switch{*/
        /*border-radius: 22px;*/
        /*width: 50px !important;*/
        /*border: none;*/
        /*padding: 0;*/
        /*}*/

        /*.bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-label*/
        /*{*/
        /*padding: 0;*/
        /*font-size: 12px;*/
        /*display: inline-block;*/
        /*}*/

        /*.bootstrap-switch .bootstrap-switch-label {*/
        /*display: none !important;*/
        /*border: none !important;*/
        /*}*/

        /*.bootstrap-switch .bootstrap-switch-handle-on{*/
        /*width: 50px !important;*/
        /*padding: 0 !important;*/
        /*border: none !important;*/
        /*}*/

        /*.bootstrap-switch .bootstrap-switch-handle-off{*/
        /*width: 50px !important;*/
        /*border: none !important;*/
        /*padding: 0 !important;*/
        /*}*/

        .switch {
            display: inline-block;
        }

        .bootstrap-switch {
            border-radius: 22px;
            width: 35px !important;
            height: 19px !important;
        }

        .bootstrap-switch .bootstrap-switch-handle-off, .bootstrap-switch .bootstrap-switch-handle-on, .bootstrap-switch .bootstrap-switch-label {
            padding: 0px;
            font-size: 10px;
            display: inline-block;
        }

        /*.bootstrap-switch .bootstrap-switch-label*/

        /*{*/

        /*width:42px !important;*/

        /*height: 22px;*/

        /*border-radius:11px !important;*/

        /*position:relative;*/

        /*}*/

        .bootstrap-switch .bootstrap-switch-handle-on {
            width: 35px !important;
            margin-right: 0px;
            padding-right: 22px;
        }

        .bootstrap-switch .bootstrap-switch-handle-off {
            width: 35px !important;
            border-radius: 11px;
            margin-left: -16px;
            /*padding-right: -30px;*/
            position: relative;
            color: #fff !important;
        }

    </style>
</head>
<body>
<div id="main-wrapper">
    <div th:replace="common/header::header"></div>
    <!--     <div th:replace="common/project_left::project_left"></div> -->
    <div th:replace="common/monitor_left::monitor_left"></div>
    <div class="page-wrapper">
        <div class="right-part right-content">
            <div class="page-breadcrumb">
                <div class="row">
                    <div class="col-lg-5 align-self-center">
                        <div class="d-flex align-items-center">
                            <nav aria-label="breadcrumb">
                                <ol class="breadcrumb">
                                    <li class="breadcrumb-item">监测管理</li>
                                    <li class="breadcrumb-item" id="groupname"></li>
                                    <li class="breadcrumb-item" id="projectname"></li>
                                    <li class="breadcrumb-item">修改方案</li>
                                </ol>
                            </nav>
                        </div>
                    </div>
                    <div class="col-lg-7 align-self-center ">
                        <div class="d-flex no-block justify-content-end align-items-center data-number-min">
                            <button class="btn btn-outline-secondary btn-sm bnone" type="button" id="gobacklist">
                                <i class="mdi mdi-redo-variant"></i> 返回
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="p-20">
                <div class="card">
                    <div class="card-body">
                        <ul class="progress-tab">
                            <li class="line-active">
                                <span>1</span>
                                <span>选择创建方案类型</span>
                            </li>
                            <li class="line-active">
                                <span>2</span>
                                <span>修改监测方案</span>
                            </li>
                            <li class="" id="createcomplete">
                                <span>3</span>
                                <span>修改方案完成</span>
                            </li>
                            <li class="" id="checkmonitor">
                                <span>4</span>
                                <span>查看监测数据</span>
                            </li>
                        </ul>
                        <div class="pro-introduce m-t-20">什么是监测方案：监测方案是与您相关或您关注的词条，通过您设置的词条，系统将把互联网中与您相关的信息内容第一时间通知您。
                        </div>
                    </div>
                </div>
                <div class="card">
                    <div class="card-body">
                        <ul class="create-tab" id="search-tab">
                            <li class="create-tab-act" data-type="2">快速修改</li>
                            <li class="" data-type="1">高级修改</li>
                            <li id="tips" data-type="3">当前是快速修改，可设置100字</li>
                        </ul>
                        <!-- tab1 start -->
                        <div id="tab2" class="card m-b-0">
                            <div class="card-body p-b-0">
                                <div class="create-line m-b-30">
                                    <span>方案名称</span>
                                    <input id="proname1" type="text" maxlength="10" class="form-control"
                                           placeholder="请输入方案名称">
                                    <span>*方案名称控制在6字符以内</span>
                                </div>
                                <div class="create-line m-b-30">
                                    <span>所属方案组名称</span>
                                    <select name="" id="groupList" class="form-control">
                                        <option value="1">涉及国家</option>
                                        <option value="1">涉及事件</option>
                                        <option value="1">涉及人物</option>
                                        <option value="1">时政风云</option>
                                    </select>
                                </div>
                                <div class="create-line2 m-b-20">
                                    <span>方案主体关键词</span>
                                    <textarea class="form-control" name="" id="prokeywords1" rows="4"
                                              placeholder=''></textarea>
                                    <div class="create-tips">
                                        <a tabindex="0" class="" data-html="true" role="button" data-toggle="popover"
                                           data-trigger="focus" title="方案主体关键词提示"
                                           data-content="1：“+”表示“并且”,“|”表示“或”
														<br>                                           
														2：什么情况下用“|”：
														如想关注北京或上海或广州的新闻，表达式为“北京|上海|广州”，表示文章中出现 “北京”、“上海”、“广州”任意一个城市就能监测到。
														<br>
														3：什么情况下用“+”：
														如想关注北京车牌摇号的新闻，表达式为“北京+车牌摇号”，表示文章中同时出现 “北京”和“车牌摇号”两个关键词才能监测到。
														<br>
														4：什么情况下同时用到“+”、“|”：
														如想关注上海世博会的新闻，由于“世博会”又可能被称为“世界博览会”，表达式为 “上海+(世博会|世界博览会)”，表示文章中出现“上海”，同时出现“世博会”或者 “世界博览会”中任意一个词，就能监测到；
														<br>
														5：什么情况下用到排除关键词：
														如想关注上海、北京、广州的新闻，但又不想看到内容中有“三室一厅”、“二室 一厅”这种关键词的广告，可以使用排除关键词的方式。 匹配关键词表达式“北京|上海|广州” 排除关键词表达式“三室一厅|二室一厅”">
                                            <i class="fa fa-question-circle"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="create-line2 m-b-20">
                                    <span>
                                    	<p>监测屏蔽歧义词</p> 
                                    	<div class="bt-switch">
                                               <!--<span><small>on(筛选) off(筛选)</small></span>-->
	                                   		<input id="bt-switch1" type="checkbox" checked data-on-color="success"
                                                   data-off-color="warning">
                                              <span><small>(筛选开关)</small></span>
	                                   	</div>
                                    </span>
                                    <textarea class="form-control" name="" id="proshield1" rows="4"
                                              placeholder='如需配置的屏蔽词生效请打开筛选,关键词之间用"|"隔开'></textarea>
                                    <div class="create-tips">
                                        <a tabindex="0" class="" data-html="true" role="button" data-toggle="popover"
                                           data-trigger="focus" title="监测屏蔽歧义词提示"
                                           data-content="1：“+”表示“并且”,“|”表示“或”
														<br>                                           
														2：什么情况下用“|”：
														如想关注北京或上海或广州的新闻，表达式为“北京|上海|广州”，表示文章中出现 “北京”、“上海”、“广州”任意一个城市就能监测到。
														<br>
														3：什么情况下用“+”：
														如想关注北京车牌摇号的新闻，表达式为“北京+车牌摇号”，表示文章中同时出现 “北京”和“车牌摇号”两个关键词才能监测到。
														<br>
														4：什么情况下同时用到“+”、“|”：
														如想关注上海世博会的新闻，由于“世博会”又可能被称为“世界博览会”，表达式为 “上海+(世博会|世界博览会)”，表示文章中出现“上海”，同时出现“世博会”或者 “世界博览会”中任意一个词，就能监测到；
														<br>
														5：什么情况下用到排除关键词：
														如想关注上海、北京、广州的新闻，但又不想看到内容中有“三室一厅”、“二室 一厅”这种关键词的广告，可以使用排除关键词的方式。 匹配关键词表达式“北京|上海|广州” 排除关键词表达式“三室一厅|二室一厅”">
                                            <i class="fa fa-question-circle"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="create-btn-group">
                                    <button class="btn btn-info m-r-10" type="button" id="gosubmit1">确定</button>
                                    <button class="btn btn-secondary" type="button" id="goback1">取消</button>
                                </div>
                            </div>
                        </div>
                        <!-- tab1 end -->
                        <!-- tab2 start -->
                        <div id="tab1" class="card m-b-0" style="display: none;">
                            <div class="card-body p-b-0">
                                <div class="create-line m-b-30">
                                    <span>方案名称</span>
                                    <input id="proname" type="text" maxlength="10" class="form-control"
                                           placeholder="请输入方案名称">
                                    <span>*方案名称控制在6字符以内</span>
                                </div>
                                <div class="create-line m-b-30">
                                    <span>所属方案组名称</span>
                                    <select id="groupList2" class="form-control">
                                        <option value="1">涉及国家</option>
                                    </select>
                                </div>
                                <div class="create-line2 m-b-20">
                                    <span>方案主体关键词</span>
                                    <textarea class="form-control" name="" id="prokeywords" rows="4"
                                              placeholder='关键词之间用逗号","隔开&#13;&#10;例如：汽车行业，别克，辉腾，三菱'></textarea>
                                    <div class="create-tips">
                                        <a tabindex="0" class="" data-html="true" role="button" data-toggle="popover"
                                           data-trigger="focus" title="方案主体关键词提示"
                                           data-content="1、地域、人物、事件 三类都可输入多个关键词，关键词之间用空格分开。三个类型都可以为空。<br>2、每一类的多个关键词之间默认为或(或者)”的关系。<br>3、地域、人物、事件三个类型之间是“与(并且)”的关系。例如：地域配置了“上海”，人物配置了“周某”，事件配置了“撞车”，只有同时满足这3个条件的文章才会被监测到。">
                                            <i class="fa fa-question-circle"></i>
                                        </a>
                                    </div>
                                </div>
                                <!-- <div class="create-line2 m-b-20">
                                    <span>国家/城市/地域 关键词</span>
                                    <textarea class="form-control" name="" id="proarea" rows="4"
                                              placeholder='关键词之间用逗号","隔开;例如：美国，上海，北京，滕家沟，南京西路'></textarea>
                                    <div class="create-tips">
                                        <a tabindex="0" class="" data-html="true" role="button" data-toggle="popover"
                                           data-trigger="focus" title="国家/城市/地域 关键词提示"
                                           data-content="1、地域、人物、事件 三类都可输入多个关键词，关键词之间用空格分开。三个类型都可以为空。<br>2、每一类的多个关键词之间默认为或(或者)”的关系。<br>3、地域、人物、事件三个类型之间是“与(并且)”的关系。例如：地域配置了“上海”，人物配置了“周某”，事件配置了“撞车”，只有同时满足这3个条件的文章才会被监测到。">
                                            <i class="fa fa-question-circle"></i>
                                        </a>
                                    </div>
                                </div> -->
                                <!-- <div class="create-line2 m-b-20">
                                    <span>人物/机构/企业 关键词</span>
                                    <textarea class="form-control" name="" id="properson" rows="4"
                                              placeholder='关键词之间用逗号","隔开；例如：马云，北京网安中心，腾讯科技'></textarea>
                                    <div class="create-tips">
                                        <a tabindex="0" class="" data-html="true" role="button" data-toggle="popover"
                                           data-trigger="focus" title="人物/机构/企业 关键词提示"
                                           data-content="1、地域、人物、事件 三类都可输入多个关键词，关键词之间用空格分开。三个类型都可以为空。<br>2、每一类的多个关键词之间默认为或(或者)”的关系。<br>3、地域、人物、事件三个类型之间是“与(并且)”的关系。例如：地域配置了“上海”，人物配置了“周某”，事件配置了“撞车”，只有同时满足这3个条件的文章才会被监测到。">
                                            <i class="fa fa-question-circle"></i>
                                        </a>
                                    </div>
                                </div> -->
                               <!--  <div class="create-line2 m-b-20">
                                    <span>事件/动词 关键词</span>
                                    <textarea class="form-control" name="" id="proaccident" rows="4"
                                              placeholder='关键词之间用逗号","隔开；例如：高管离职，拖欠工资，跑路，开销，焦虑'></textarea>
                                    <div class="create-tips">
                                        <a tabindex="0" class="" data-html="true" role="button" data-toggle="popover"
                                           data-trigger="focus" title="事件/动词 关键词提示"
                                           data-content="1、地域、人物、事件 三类都可输入多个关键词，关键词之间用空格分开。三个类型都可以为空。<br>2、每一类的多个关键词之间默认为或(或者)”的关系。<br>3、地域、人物、事件三个类型之间是“与(并且)”的关系。例如：地域配置了“上海”，人物配置了“周某”，事件配置了“撞车”，只有同时满足这3个条件的文章才会被监测到。">
                                            <i class="fa fa-question-circle"></i>
                                        </a>
                                    </div>
                                </div> -->
                                <div class="create-line2 m-b-20">
                                    <!--<span>监测屏蔽歧义词</span>-->
                                    <span>
                                    	<p>监测屏蔽歧义词</p>
                                    	<div class="bt-switch">
                                            <!--<span><small>on(筛选) off(筛选)</small></span>-->
	                                   		<input id="bt-switch" type="checkbox" checked data-on-color="success"
                                                   data-off-color="warning">
                                            <span><small>(筛选开关)</small></span>
	                                   	</div>
                                    </span>
                                    <textarea class="form-control" name="" id="proshield" rows="4"
                                              placeholder='如需配置的屏蔽词生效请打开筛选,关键词之间用逗号","隔开&#13;&#10;例如：合作，用不，二娃，流连'></textarea>
                                    <div class="create-tips">
                                        <a tabindex="0" class="" data-html="true" role="button" data-toggle="popover"
                                           data-trigger="focus" title="监测屏蔽歧义词提示"
                                           data-content="1、地域、人物、事件 三类都可输入多个关键词，关键词之间用空格分开。三个类型都可以为空。<br>2、每一类的多个关键词之间默认为或(或者)”的关系。<br>3、地域、人物、事件三个类型之间是“与(并且)”的关系。例如：地域配置了“上海”，人物配置了“周某”，事件配置了“撞车”，只有同时满足这3个条件的文章才会被监测到。">
                                            <i class="fa fa-question-circle"></i>
                                        </a>
                                    </div>
                                </div>
                                <div class="create-btn-group">
                                    <button class="btn btn-info m-r-10" type="button" id="gosubmit">确定</button>
                                    <button class="btn btn-secondary" type="button" id="goback">取消</button>
                                </div>
                            </div>
                        </div>
                        <!-- tab2 end -->
                    </div>
                </div>
            </div>
            <div class="page-footer">
                © 2014-<span id="currentyear"></span> 南京涌亿思信息技术有限公司 苏ICP备17066984号-1
            </div>
        </div>
    </div>
</div>

<script th:src="@{/assets/libs/jquery/dist/jquery.min.js}"></script>
<script th:src="@{/assets/libs/popper.js/dist/umd/popper.min.js}"></script>
<script th:src="@{/assets/libs/bootstrap/dist/js/bootstrap.min.js}"></script>
<script th:src="@{/dist/js/app.min.js}"></script>
<script th:src="@{/dist/js/app.init.light-sidebar.js}"></script>
<script th:src="@{/dist/js/app-style-switcher.js}"></script>
<script th:src="@{/assets/libs/perfect-scrollbar/dist/perfect-scrollbar.jquery.min.js}"></script>
<script th:src="@{/assets/extra-libs/sparkline/sparkline.js}"></script>
<script th:src="@{/dist/js/waves.js}"></script>
<script th:src="@{/dist/js/sidebarmenu.js}"></script>
<script th:src="@{/dist/js/custom.min.js}"></script>
<script th:src="@{/dist/js/projectlist.js}"></script>
<script th:src="@{/dist/js/pages.js}"></script>
<script th:src="@{/common/tools.js}"></script>
<script th:src="@{/assets/libs/block-ui/jquery.blockUI.js}"></script>
<script th:src="@{/assets/libs/sweetalert2/dist/sweetalert2.all.min.js}"></script>
<script th:src="@{/assets/libs/bootstrap-switch/dist/js/bootstrap-switch.min.js}"></script>
<script th:src="@{/dist/baidu/baidu_statistics.js}"></script>

<script type="text/javascript" th:inline="javascript">
$("#currentyear").text((new Date()).getFullYear());

    let edit_projectid = '[[${edit_projectid}]]';
    let edit_groupid = '[[${edit_groupid}]]';
    var groupId = [[${groupId}]];

    $(document).ready(function () {
        getEditInfo(edit_projectid);
    });

    // 左侧方案切换
    function switchProject(event) {
        let $event = $(event);
        groupId = $event.attr("data-groupid");
        projectId = $event.attr("data-index");
        edit_projectid = projectId;
        edit_groupid = groupId;
        setBrowserUrl();
        getEditInfo(edit_projectid);
    }

    // 设置浏览器地址变换
    function setBrowserUrl() {
        var url = '/project/editproject?groupid=' + edit_groupid + '&projectid=' + edit_projectid;
        setUrl(url);
    }

    function getEditInfo(edit_projectid) {
        $.ajax({
            url: ctxPath + "project/getedit",
            type: "get",
            data: {
                projectid: edit_projectid
            },
            success: function (res) {
                res = JSON.parse(res);
                sendGroupByadd();
                let code = res.code;
                let msg = res.msg;
                if (code == 200) {
                    let data = res.data;
                    let project_type = data.project_type;
                    let group_id = data.group_id;
                    let subject_word = data.subject_word;
                    let stop_word = data.stop_word;
                    let project_name = data.project_name;
                    let group_name = data.group_name;
                    /* let character_word = data.character_word;
                    let event_word = data.event_word;
                    let regional_word = data.regional_word; */
                    let character_word = '';
                    let event_word = '';
                    let regional_word = '';
                    
                    
                    
                    let precise = data.precise;

                    if (project_type == 1) { // 高级方案
                        $("#search-tab").find("li").eq(0).removeClass("create-tab-act");
                        $("#search-tab").find("li").eq(1).addClass("create-tab-act");
                        $("#tab1").css("display", "none");
                        $("#tab2").css("display", "block");
                        $("#proname").val(project_name);
                        $("#prokeywords").val(subject_word);
                        $("#proshield").val(stop_word);
                        $("#proarea").val(regional_word);
                        $("#properson").val(character_word);
                        $("#proaccident").val(event_word);

                        $("#proname1").val(project_name);
                        $("#prokeywords1").val(subject_word);
                        $("#proshield1").val(stop_word);
//                        if (precise == "0") {
//                            $("#bt-switch").bootstrapSwitch('state', false, true);
//                        } else {
//                            $("#bt-switch").bootstrapSwitch('state', true, true);
//                        }
                        if (precise == "0") {
                            $("#bt-switch1").bootstrapSwitch('state', false, true);
                            $("#bt-switch").bootstrapSwitch('state', false, true);
                        } else {
                            $("#bt-switch1").bootstrapSwitch('state', true, true);
                            $("#bt-switch").bootstrapSwitch('state', true, true);
                        }

                    } else if (project_type == 2) { // 普通方案
                        $("#tab2").css("display", "none");
                        $("#tab1").css("display", "block");
                        $("#search-tab").find("li").eq(1).removeClass("create-tab-act");
                        $("#search-tab").find("li").eq(0).addClass("create-tab-act");
                        $("#proname1").val(project_name);
                        $("#prokeywords1").val(subject_word);
                        $("#proshield1").val(stop_word);
//                        $("#bt-switch1").prop("checked",false);
                        if (precise == "0") {
                            $("#bt-switch1").bootstrapSwitch('state', false, true);
                            $("#bt-switch").bootstrapSwitch('state', false, true);
                        } else {
                            $("#bt-switch1").bootstrapSwitch('state', true, true);
                            $("#bt-switch").bootstrapSwitch('state', true, true);
                        }

                        $("#proname").val(project_name);
                        $("#prokeywords").val(subject_word);
                        $("#proshield").val(stop_word);
                        if (regional_word) $("#proarea").val(regional_word);
                        if (character_word) $("#properson").val(character_word);
                        if (event_word) $("#proaccident").val(event_word);
                    }
                    $("#groupname").html(group_name);
                    $("#projectname").html(project_name);
                }
            },
            error: function (xhr, ajaxOptions, thrownError) {
                if (xhr.status == 403) {
                    window.location.href = ctxPath + "login";
                } else {
                    console.log(thrownError);
                }
            }
        });
    }

    function sendGroupByadd() {
        $.ajax({
            type: "POST",
            url: ctxPath + "project/groupandproject",
            dataType: 'json',
            data: {},
            success: function (res) {
                let code = res.code;
                if (code == 200) {
                    let data = res.data;
                    let groupStr = '';
                    for (let i = 0; i < data.length; i++) {
                        let dataJson = data[i];
                        let group_id = dataJson.group_id;
                        let group_name = dataJson.group_name;
                        if (group_id == groupId) {
                            groupStr += '<option selected value="' + group_id + '">' + group_name + '</option>'
                        } else {
                            groupStr += '<option value="' + group_id + '">' + group_name + '</option>'
                        }
                    }
                    $("#groupList").html(groupStr); // 修改方案 普通方案 方案组下拉框
                    $("#groupList2").html(groupStr); // 修改方案 高级方案 方案组下拉框
                } else {
                    showInfo("出错啦，请稍后再试");
                }
            },
            error: function (xhr, ajaxOptions, thrownError) {
                if (xhr.status == 403) {
                    window.location.href = ctxPath + "login";
                } else {
                    console.log(thrownError);
                }
            }
        });
    }

    // 发送修改方案的信息
    function sendEditProjectInfo(data) {
        $.ajax({
            url: ctxPath + "project/commiteditproject",
            type: "post",
            contentType: 'application/json;charset=utf-8',
            data: JSON.stringify(data),
            success: function (res) {
                console.log(res)
                let code = res.code;
                if (code == 200) {
                    let g_id = data.group_id;
                    let p_id = data.project_id;
                    $("#createcomplete").addClass("line-active");
                    showInfoResult("方案修改完成", "稍后可以到数据监测中查看该方案的数据监测", g_id, p_id);
                } else {
                    showInfo("修改方案失败!");
                }
            },
            error: function (xhr, ajaxOptions, thrownError) {
                if (xhr.status == 403) {
                    window.location.href = ctxPath + "login";
                } else {
                    console.log(thrownError);
                }
            }
        });
    }

    $("#goback1").click(function (param) {
        $("#proname1").removeClass("text-error");
        $("#prokeywords1").removeClass("text-error");
        $("#proshield1").removeClass("text-error");
        $("#createcomplete").removeClass("line-active");
        window.location.href = ctxPath + "project";
    });

    $(document).on('click', '#goback', function (param) {
        $("#proname1").removeClass("text-error");
        $("#prokeywords1").removeClass("text-error");
        $("#proshield1").removeClass("text-error");
        $("#createcomplete").removeClass("line-active");
        window.location.href = ctxPath + "project";
    });

    $("#goclear").click(function () {
        $("#proname").val("");
        $("#prokeywords").val("");
        $("#properson").val("");
        $("#proarea").val("");
        $("#proaccident").val("");
        $("#proshield").val("");
    });

    // 高级方案确认
    $("#gosubmit").click(function () {
        var proname = $("#proname").val();
        var prokeywords = $("#prokeywords").val();
        /* var properson = $("#properson").val();
        var proarea = $("#proarea").val();
        var proaccident = $("#proaccident").val(); */
        
        var properson = '';
        var proarea = '';
        var proaccident = '';
        var proshield = $("#proshield").val();
        if (proname == '') {
            $("#proname").addClass("text-error");
            showtips("请填写完整！")
        } else {
            $("#proname").removeClass("text-error");
        }
        if (proname.length > 6) {
            showtips("方案组名称长度最多六个字符");
            return;
        }
        if (prokeywords == '') {
            $("#prokeywords").addClass("text-error");
            showtips("请填写完整！");
        } else {
            $("#prokeywords").removeClass("text-error");
        }
        
        if (prokeywords == proshield) {
        	showtips("关键词与屏蔽词不能相同");
            return;
        }
        
        prokeywords = prokeywords.toString().replace(/(\s|;|-|"|‘|；|、|‘’|'|’|“”|》|《|<|>|\.|。)/g, ",");
        prokeywords = prokeywords.toString().replace(/,{1,}/, ",");
        if (prokeywords.indexOf("，") != -1) {
            prokeywords = prokeywords.toString().replace(new RegExp("，", 'gm'), ",");
        }
        if (properson.indexOf("，") != -1) {
            properson = properson.toString().replace(new RegExp("，", 'gm'), ",");
        }
        if (proarea.indexOf("，") != -1) {
            proarea = proarea.toString().replace(new RegExp("，", 'gm'), ",");
        }
        if (proaccident.indexOf("，") != -1) {
            proaccident = proaccident.toString().replace(new RegExp("，", 'gm'), ",");
        }
        proshield = proshield.toString().replace(/(\s|;|-|"|‘|；|、|‘’|'|’|“”|》|《|<|>|\.|。)/g, ",");
        proshield = proshield.toString().replace(/,{1,}/, ",");
        if (proshield.indexOf("，") != -1) {
            proshield = proshield.toString().replace(new RegExp("，", 'gm'), ",");
        }
        let prokeywordsArray = prokeywords.split(",");
        if (prokeywordsArray.length >= 100) {
            showInfo("关键词不能超过100个！");
        }
        let propersonArray = properson.split(",");
        if (propersonArray.length >= 100) {
            showInfo("人物词不能超过100个！");
        }
        let proareaArray = proarea.split(",");
        if (proareaArray.length >= 100) {
            showInfo("地域词不能超过100个！");
        }
        let proaccidentArray = proaccident.split(",");
        if (proaccidentArray.length >= 100) {
            showInfo("事件词不能超过100个！");
        }
        let proshieldArray = proshield.split(",");
        if (proshieldArray.length >= 100) {
            showInfo("屏蔽词不能超过100个！");
        }
        if (proname != '' && prokeywords != '' && prokeywordsArray.length < 100
            && propersonArray.length < 100 && proareaArray.length < 100
            && proaccidentArray.length < 100 && proshieldArray.length < 100) {
            let group_id = $("#groupList2 option:selected").val();
            let precise = 0;
            if ($('#bt-switch').is(':checked')) {
                precise = 1;
            }
            let dataJson = new Object();
            dataJson.project_name = proname;
            dataJson.subject_word = prokeywords;
            dataJson.stop_word = proshield;
            dataJson.group_id = group_id;
            dataJson.project_type = 2;
            dataJson.precise = precise;
            dataJson.project_id = edit_projectid;
            dataJson.event_word = proaccident; // 事件关键词
            dataJson.regional_word = proarea; // 地域词
            dataJson.character_word = properson;  // 人物关键词
            sendEditProjectInfo(dataJson);
        }
    });

    // 切换快速创建和高级方案
    $("#search-tab li").on("click", function () {
        var tip = $(this).attr("data-type")
        switch (tip) {
            case "2":
                $(this).siblings().removeClass("create-tab-act");
                $(this).addClass("create-tab-act");
                $("#tips").html("当前是快速修改，可设置100字");
                $("#tab2").hide();
                $("#tab1").show();
                break;
            case "1":
                $(this).siblings().removeClass("create-tab-act");
                $(this).addClass("create-tab-act");
                $("#tips").html("当前是高级修改，可设置550字");
                $("#tab1").hide();
                $("#tab2").show();
                break;
            case "3":
                break;
            default:
                break;
        }
    });

    /**
     * @description 快速修改普通方案数据
     */
    $("#gosubmit1").click(function (param) {
        var proname = $("#proname1").val();  // 方案名称
        var prokeywords = $("#prokeywords1").val();  // 关键词
        var proshield = $("#proshield1").val(); // 屏蔽词
        if (proname == '') {
            $("#proname1").addClass("text-error");
            showtips("请填写完整！")
        } else {
            $("#proname1").removeClass("text-error");
        }
        if (proname.length > 6) {
            showtips("方案组名称长度最多六个字符");
            return;
        }
        if (prokeywords == '') {
            $("#prokeywords1").addClass("text-error");
            showtips("请填写完整！")
        } else {
            $("#prokeywords1").removeClass("text-error");
        }
        
        if (prokeywords == proshield) {
        	showtips("关键词与屏蔽词不能相同");
            return;
        }
        
        
        
        $("#createcomplete").addClass("line-active");

        prokeywords = prokeywords.toString().replace(/(\s|;|-|"|‘|；|、|‘’|'|’|“”|》|《|<|>|\.|。)/g, ",");
        prokeywords = prokeywords.toString().replace(/,{1,}/, ",");
        if (prokeywords.indexOf("，") != -1) {
            prokeywords = prokeywords.toString().replace(new RegExp("，", 'gm'), ",");
        }
        proshield = proshield.toString().replace(/(\s|;|-|"|‘|；|、|‘’|'|’|“”|》|《|<|>|\.|。)/g, ",");
        proshield = proshield.toString().replace(/,{1,}/, ",");
        if (proshield.indexOf("，") != -1) {
            proshield = proshield.toString().replace(new RegExp("，", 'gm'), ",");
        }
        let prokeywordsArray = prokeywords.split(",");
        if (prokeywordsArray.length >= 100) {
            showInfo("关键词不能超过100个！");
        }


        let proshieldArray = proshield.split(",");
        if (proshieldArray.length >= 100) {
            showInfo("屏蔽词词不能超过100个！");
        }

        if (proname != '' && prokeywords != '' && proshieldArray.length < 100 && prokeywordsArray.length < 100) {
            let group_id = $("#groupList option:selected").val();
            let precise = 0;
            if ($('#bt-switch1').is(':checked')) {
                precise = 1;
            }
            let dataJson = new Object();
            dataJson.project_name = proname;
            dataJson.subject_word = prokeywords;
            dataJson.stop_word = proshield;
            dataJson.group_id = group_id;
            dataJson.precise = precise;
            dataJson.project_id = edit_projectid;
            dataJson.project_type = 1;
            sendEditProjectInfo(dataJson);
        }
    });

    $('.navLi').click(function () {
        jumpNavLocation($(this).data('type'), edit_groupid, edit_projectid);
    })

    $(".bt-switch input[type='checkbox']").bootstrapSwitch({
        onText: "ON",
        offText: "OFF",
        onColor: "success",
        offColor: "warning",
        size: "mini",
        handleWidth: "10",
        onSwitchChange: function (event, state) {
            window.parent.Warn_Start = state;
            var $el = $(event.el)
                , value = event.value;
            var step = this.value;
            if (state == true) {
//                 alert(1)
            } else {
//             	alert(2)
            }
        }
    });


    /**
     * 返回事件
     */
    $("#gobacklist").click(function () {
        window.location.href = "/project?page=1&groupid=" + edit_groupid + "&projectsearch=";
    });

</script>
</body>

</html>